import {expect} from "chai";
import { Euler } from "../src/Euler";
import { Quat } from "../src/Quat";
describe("Euler", function () {
    before(function() {
        console.log("开始自动化测试Euler...");
    });

    after(function() {
        console.log("结束...");
    });
    beforeEach(function() {
    });

    afterEach(function() {
    });
    it('#constructor', function () {
        let euler=new Euler([Math.PI/6,Math.PI/4,Math.PI/3]);
        expect(euler.equal([Math.PI/6,Math.PI/4,Math.PI/3])).to.equal(true);
    });
    it('#order', function () {
        let euler=new Euler([Math.PI/6,Math.PI/4,Math.PI/3]);
        euler.order="xyz";
        expect(euler.order).to.equal("xyz");
    });
    it('#x', function () {
        let euler=new Euler([Math.PI/6,Math.PI/4,Math.PI/3]);
        expect(euler.x).to.equal(Math.PI/6);
    });
    it('#y', function () {
        let euler=new Euler([Math.PI/6,Math.PI/4,Math.PI/3]);
        expect(euler.y).to.equal(Math.PI/4);
    });
    it('#z', function () {
        let euler=new Euler([Math.PI/6,Math.PI/4,Math.PI/3]);
        expect(euler.z).to.equal(Math.PI/3);
    });
    it('#copy', function () {
        let euler=new Euler([Math.PI/6,Math.PI/4,Math.PI/3]);
        let euler1=new Euler();
        euler1.copy(euler);
        expect(euler.equal(euler1)).to.equal(true);
    });
    it('#equal', function () {
        let euler=new Euler([Math.PI/6,Math.PI/4,Math.PI/3]);
        let euler1=new Euler();
        euler1.copy(euler);
        expect(euler.equal(euler1)).to.equal(true);
    });
    it('#toString', function () {
        let euler=new Euler([1,2,3]);
        expect(euler.toString()).to.equal("Euler(1,2,3)");
    });
    it('#identity', function () {
        let euler=new Euler([Math.PI/6,Math.PI/4,Math.PI/3]);
        euler.identity();
        expect(euler.equal([0,0,0])).to.equal(true);
    });
    it('#fromQuat', function () {
        let quat=new Quat([1,2,3,4]);
        let euler=new Euler();
        euler.fromQuat(quat);
        expect(euler.equal([0.7853982,0.3398369,1.4288993])).to.equal(true);
    });
})